package com.lg.spring.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Date;
import java.util.Map;

/**
 * Spring Boot 支持 JSP
 *
 * @author by Mr. Li 2020/9/11 13:12
 */
@Controller
public class JspController {

	@GetMapping("/jsp")
	public String test(Map<String, Object> model) {
		model.put("date", new Date());
		model.put("message", "hello world");

		return "result";
	}

	@RequestMapping("/jspError")
	public String jspError(Map<String, Object> model) {
		throw new RuntimeException("jspError");
	}
}
